home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
A Field Trip to the Sky (Demo)
/
Mac_Sunburst_AFieldTripToTheSky-Demo.iso
/
DIR
/
GAME.DIR
/
00103_Script_Game State
< prev
next >
Wrap
Text File
|
1996-03-27
|
2KB
|
114 lines
global gGameFrame, gGameObject, gCurObject, gPuppetList
global gPower
-- ïï saveState ïï
on saveState
gameSave()
end
-- ïï restoreState ïï
on restoreState
gameRestore()
end
--ïï gameSave ïï
-- save a game to be restored when we return to this movie
on gameSave
put "gameSave"
-- save the frame so we can return to it
set gGameFrame to the frame
-- save the object
set gGameObject to gCurObject
set gPuppetList to []
repeat with i = 1 to 35
add( gPuppetList, the puppet of sprite i)
if i = 12 then
add gPuppetList, the locH of sprite i
else
add( gPuppetList, the castNum of sprite i)
end if
if the puppet of sprite i then
put "gameSave" && the name of cast the castNum of sprite i, the castNum of sprite i, i
end if
end repeat
end
--ïï gameRestore ïï
-- restore a game when we return to this movie
on gameRestore
global gTellGameToRestore
set gTellGameToRestore to TRUE
-- restore the object from our guide jaunt
if( gGameObject <> 0 ) then set gCurObject to gGameObject
-- and go to the right frame
if( gGameObject <> 0 ) then go to gGameFrame
end
--ïï gameRestorePuppets ïï
-- restore a game when we return to this movie
on gameRestorePuppets
global gTellGameToRestore
set gTellGameToRestore to FALSE
if gPuppetList <> 0 then
set j to 1
repeat with i = 1 to 35
if( getAt(gPuppetList,j) ) then
puppetSprite i, TRUE
if i = 12 then
set the locH of sprite i to getAt(gPuppetList,j+1)
else
set the castNum of sprite i to getAt(gPuppetList,j+1)
end if
put "gameRestore", i, the name of cast getAt(gPuppetList,j+1), getAt(gPuppetList,j+1)
end if
set j to j + 2
end repeat
end if
updateStage
end
--ïï gameReset ïï
-- reset a game
on gameReset
set gGameFrame to 0
repeat with i = 1 to 48
puppetSprite i, FALSE
end repeat
setPlanet()
-- save the object
set gGameObject to gCurObject
-- set the visible of sprite 45 to FALSE
-- set the visible of sprite 46 to FALSE
set gPower to 0
end